package com.mb.note.controller;

import com.lijian.common.domain.R;
import com.lijian.common.util.BeanUtils;
import com.mb.note.domain.dto.NoteDto;
import com.mb.note.domain.po.Category;
import com.mb.note.domain.po.Note;
import com.mb.note.service.CategoryService;
import com.mb.note.service.NoteService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author LiJian
 * @date 2024-11-04
 */
@Api(tags = "目录相关接口")
@RestController
@RequestMapping("/category")
@RequiredArgsConstructor
public class CategoryController {
    private final CategoryService categoryService;
    @ApiOperation("添加二级目录")
    @GetMapping("addCategory")
    public R<?> addCategory(@RequestBody Category category) {
        return R.ok(categoryService.save(category));
    }
    @ApiOperation("获取二级目录")
    @GetMapping("getCategoryTwo")
    public R<?> getCategoryTwo(@RequestParam String fid) {
        return R.ok( categoryService.getCategoryTwo(fid));
    }

}
